<!DOCTYPE html>
<html>
<% include ./head.html%>

<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="/js/kindeditor/lang/zh-CN.js"></script>

<script type="text/javascript" src="/javascript/getStoryInfo.js"></script>
<!--
<script type="text/javascript" src="/js/layer.js></script>
-->
<script type="text/javascript">
    //KindEditor脚本
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('#detailContent', {
            //uploadJson: '/Home/UploadImage',
            items : ['image'],
            themeType : 'simple',
            uploadJson: '/controller/uploadImage',
            allowImageUpload:true,//允许上传图片
            allowFileManager:true,//允许上传图片
            allowImageRemote : false, //上传图片框网络图片的功能，false为隐藏，默认为true

            afterCreate : function(msg) {
                console.log("1111111111",msg)
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                });
            },afterUpload: function(url, message, error){
                console.log("333333333333333",url)
                console.log("333333333333333",message)
                console.log("333333333333333",error)
                this.sync()
            }
        });

    });
</script>
<script>

</script>
<body style="" class=" ">

<div id="wrapper">

    <nav class=" top navbar navbar-static-top" style="background-color: #3b485b;margin-bottom: 0" role="navigation">
        <%- user.topInfo %>
    </nav>

    <script type="text/javascript">
        $("#username").html(' <%= user.username %>');

        $(function(){
            // $(".top").load("/top",{content_analysis:'operate',nav_second_level:'channelDetail'});
            // $(".menu").load("/menu",{content_analysis:'operate',nav_second_level:'channelDetail'});

            var now = new Date();

            $('#startTime').val(moment().subtract(7, 'days').format('YYYY-MM-DD'));
            $('#endTime').val(moment().subtract(-7, 'days').format('YYYY-MM-DD'));

            $('#timeInfo').html($('#startTime').val() + " ~ " + $('#endTime').val());

            $('#time').html(moment().subtract(-1, 'days').format('YYYY-MM-DD'));

            $('#reportrange').daterangepicker(
                {
              //      maxDate : moment(), //最大时间

                    showDropdowns : true,
                    showWeekNumbers : false, //是否显示第几周
                    timePicker : false, //是否显示小时和分钟
                    timePickerIncrement : 1, //时间的增量，单位为分钟
                    timePicker24Hour : true, //是否使用12小时制来显示时间
                    ranges : {
                        '前日': [moment().subtract('days', 2).startOf('day'), moment().subtract('days', 2).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        //  '最近30日': [moment().subtract('days', 29), moment()]
                    },
                    opens : 'left', //日期选择框的弹出位置
                    // buttonClasses : [ 'btn btn-default' ],
                    applyClass : 'btn-small btn-primary blue',
                    cancelClass : 'btn-small',
                    format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
                    separator : ' to ',
                    "linkedCalendars": false,
                    locale : {
                        applyLabel : '确定',
                        cancelLabel : '取消',
                        fromLabel : '起始时间',
                        toLabel : '结束时间',
                        customRangeLabel : '自定义',
                        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                        monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                        firstDay : 1
                    }
                }, function(start, end, label) {//格式化日期显示框
                    $('#startTime').val(start.format('YYYY-MM-DD'));
                    $('#endTime').val(end.format('YYYY-MM-DD'));

                    $('#timeInfo').html($('#startTime').val() + " ~ " + $('#endTime').val());
                    getSroryInfo();
                }).click(function(){
                $('.daterangepicker').addClass('show-calendar');
            });


            $('#reportrange2').daterangepicker(
                {
                   // maxDate : moment(), //最大时间
                    //dateLimit : {
                    //    days : 30
                    //}, //起止时间的最大间隔
                    showDropdowns : true,
                    singleDatePicker:true,
                    showWeekNumbers : false, //是否显示第几周
                    timePicker : false, //是否显示小时和分钟
                    timePickerIncrement : 1, //时间的增量，单位为分钟
                    timePicker24Hour : true, //是否使用12小时制来显示时间
                    ranges : {
                        '前日': [moment().subtract('days', 2).startOf('day'), moment().subtract('days', 2).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        //  '最近30日': [moment().subtract('days', 29), moment()]
                    },
                    opens : 'left', //日期选择框的弹出位置
                    // buttonClasses : [ 'btn btn-default' ],
                    applyClass : 'btn-small btn-primary blue',
                    cancelClass : 'btn-small',
                    format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式
                    separator : ' to ',
                    "linkedCalendars": false,
                    locale : {
                        applyLabel : '确定',
                        cancelLabel : '取消',
                        fromLabel : '起始时间',
                        toLabel : '结束时间',
                        customRangeLabel : '自定义',
                        daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                        monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                            '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                        firstDay : 1
                    }
                }, function(start, end, label) {//格式化日期显示框
                    $('#time').val(start.format('YYYY-MM-DD'));
                    $('#time').html(start.format('YYYY-MM-DD'));
                })


            getSroryInfo();
        })


    </script>

    <nav class="menu navbar-default navbar-static-side" role="navigation">
        <% include ./menu.html%>
    </nav>

    <script type="text/javascript">
        displayView("home", "storyInfo");
    </script>

    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="wrapper wrapper-content  animated fadeInRight">

            <div class="row">

                <div class="col-lg-12">
                    <div class="ibox ">
                        <div class="ibox-title">
                            <h5> 重阳故事内容：</h5>

                            <div class="col-lg-3 col-sm-3 navbar-right">
                                <input id="startTime" type="hidden" style="" class=""  name="" value="" />
                                <input id="endTime" type="hidden" style="" class=""  name="" value="" />
                                <div id="reportrange" class="input-daterange input-group col-md-3" style="float: right;min-width:250px ">
                                    <div  id="reportrangedown" class="dropdown" style="margin-right: 10px" >
                                        <button class="form-control" type="text" style="border:1px solid green; " data-toggle="" >
                                            <span class="glyphicon glyphicon-calendar" Id="timeInfo"> </span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div  class="pagination"></div>
                        </div>

                        <div class="ibox-content" id="specialOrder" style="display: block;overflow: auto;">
                            <table id="specialOrderList" class="table table-bordered">
                                <thead>

                                </thead>

                                <tbody>

                                </tbody>
                            </table>
                            <div class="col-lg-6" id="pagination" class="pagination"></div>
                        </div>

                    </div>
                </div>


                <div class="col-lg-12">
                    <div class="ibox ">
                        <div class="ibox-title ">

                            <div class="col-lg-12 ">
                                <h5> 重阳故事内容添加：</h5>
                            </div>


                        </div>

                        <div class="ibox-content" id="commOrder" style="display: block;overflow: auto;">
                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-addon" >外围显示-标题</span>
                                    <input type="text" class="form-control" id="title" placeholder="" aria-describedby="basic-addon1">
                                </div>
                            </div>

                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-addon" i>外围显示-内容</span>
                                    <input type="text" id="msg" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                            </div>

                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-addon" i>外围显示-时间</span>
                                    <div id="reportrange2" class="input-daterange input-group col-md-3" style="min-width:250px ">
                                        <div  id="reportrangedown2" class="dropdown" style="margin-right: 10px" >
                                            <button class="form-control" type="text" style="border:1px solid green; " data-toggle="" >
                                                <span class="glyphicon glyphicon-calendar" Id="time"> </span>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-addon" i>具体内容-标题</span>
                                    <input type="text" id="detailTitle" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                            </div>

                            <div class="col-lg-12" style="display: none">
                                <div class="input-group">
                                    <span class="input-group-addon" i>具体内容-图片</span>
                                    <input id="imageSent" name="fulAvatar" type="file" class="form-control" />
                                </div>
                            </div>

                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-addon" i>具体内容-内容</span>
                                    <textarea style="height: 150px" type="text" id="detailContent" class="form-control" placeholder="" aria-describedby="basic-addon1" ></textarea>
                                </div>
                            </div>

                            <div class="col-lg-12">
                                <button class="col-lg-3 btn btn-success col-lg-offset-9"  onclick="addStoryInfo()"> 添加</button>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="TEXT-ALIGN: center;margin:0 auto;;">
        </div>
    </div>
</div>

<!--统计代码，可删除-->

</body>

</html>
